From 619486b2b1b668db6995e735736257037374ee0a Mon Sep 17 00:00:00 2001 From: "awilliam@xenbuild.aw" Date: Tue, 8 Aug 2006 14:36:21 -0600 Subject: [PATCH] [IA64] enable ioports_deny_access for dom0 Signed-off-by: Tristan Gingold --- xen/arch/ia64/xen/mm.c | 13 +++++++++---- xen/arch/ia64/xen/xensetup.c | 4 +++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/xen/arch/ia64/xen/mm.c b/xen/arch/ia64/xen/mm.c index 6e3b31bf63..a31a054c4f 100644 --- a/xen/arch/ia64/xen/mm.c +++ b/xen/arch/ia64/xen/mm.c @@ -838,7 +838,7 @@ ioports_permit_access(struct domain *d, unsigned long fp, unsigned long lp) for (off = fp_offset; off <= lp_offset; off += PAGE_SIZE) __assign_domain_page(d, IO_PORTS_PADDR + off, - ia64_iobase + off, ASSIGN_nocache); + __pa(ia64_iobase) + off, ASSIGN_nocache); return 0; } @@ -859,18 +859,23 @@ ioports_deny_access(struct domain *d, unsigned long fp, unsigned long lp) int ret; struct mm_struct *mm = &d->arch.mm; unsigned long off; + unsigned long io_ports_base; unsigned long fp_offset; unsigned long lp_offset; ret = rangeset_remove_range(d->arch.ioport_caps, fp, lp); if (ret != 0) return ret; + if (d == dom0) + io_ports_base = __pa(ia64_iobase); + else + io_ports_base = IO_PORTS_PADDR; - fp_offset = IO_SPACE_SPARSE_ENCODING(fp) & ~PAGE_MASK; + fp_offset = IO_SPACE_SPARSE_ENCODING(fp) & PAGE_MASK; lp_offset = PAGE_ALIGN(IO_SPACE_SPARSE_ENCODING(lp)); - for (off = fp_offset; off <= lp_offset; off += PAGE_SIZE) { - unsigned long mpaddr = IO_PORTS_PADDR + off; + for (off = fp_offset; off < lp_offset; off += PAGE_SIZE) { + unsigned long mpaddr = io_ports_base + off; unsigned long port; volatile pte_t *pte; pte_t old_pte; diff --git a/xen/arch/ia64/xen/xensetup.c b/xen/arch/ia64/xen/xensetup.c index bc7014d882..70e34ed001 100644 --- a/xen/arch/ia64/xen/xensetup.c +++ b/xen/arch/ia64/xen/xensetup.c @@ -525,8 +525,10 @@ printk("num_online_cpus=%d, max_cpus=%d\n",num_online_cpus(),max_cpus); init_trace_bufs(); - if (opt_xencons) + if (opt_xencons) { console_endboot(); + serial_endboot(); + } domain0_ready = 1; -- 2.30.2